package com.spzx.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.spzx.product.api.domain.*;
import com.spzx.product.api.domain.vo.SkuStockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品Service接口
 */
public interface IProductService extends IService<Product> {
    List<Product> getProductList(Product product);

    //新增商品
    int addProduct(Product product);

    //获取商品详细信息
    Product getProductById(Long id);

    //修改商品
    int updateProduct(Product product);

    //删除商品
    int deleteProductByIds(Long[] ids);

    //商品审核
    void updateAuditStatus(Long id, Integer auditStatus);

    //更新上下架状态
    void updateStatus(Long id, Integer status);

    //=========================前台页面接口=========================
    //获取销售量好的sku
    List<ProductSku> getTopSale();

    List<ProductSku> getProductSkuList(SkuQuery skuQuery);

    //====================商品详情六个接口=======================
    ProductSku getProductSku(Long skuId);

    Product getProductInfo(Long id);

    SkuPrice getProductSkuPrice(Long skuId);

    ProductDetails getProductDetails(Long productId);

    Map<String, Long> getSkuSpecInfo(Long productId);

    SkuStockVo getSkuStock(Long skuId);




    //======================END================================

    //批量获取商品sku最新价格信息
    List<SkuPrice> getSkuPriceList(List<Long> skuIdList);

    //检查与锁定库存
    String checkAndLock(String orderNo, List<SkuLockVo> skuLockVoList);

    //解锁库存
    void unlock(String orderNo);

    //扣减库存
    void minus(String orderNo);
}
